Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow trailing commas in array #6

Merged
merged 2 commits into from
Mar 5, 2018

Conversation

sqs
Copy link
Contributor

@sqs sqs commented Mar 3, 2018

Previously, allowTrailingCommas only allowed trailing commas in objects, and it would still return errors for JSON like [1, 2, ]. This was surprising to me as a user. Is there a reason for allowing trailing commas in objects but not arrays?

Also fixes the assertValidParse helper. It was not failing even when there were parse errors (because it only failed if there were parse errors AND the first parse error's code was "undefined"; I couldn't find a case where that would be true).

sqs added 2 commits March 2, 2018 22:14
Previously, allowTrailingCommas only allowed trailing commas in objects.
Previously, it only failed the test if an error's code was "undefined".
@aeschli
Copy link
Contributor

aeschli commented Mar 5, 2018

Makes sense, thanks @sqs !

@sqs
Copy link
Contributor Author

sqs commented Mar 5, 2018

Thanks for the quick merge! BTW we are shipping this in Sourcegraph Server for users and admins to edit config. It works great.

@aeschli aeschli added this to the March 2018 milestone Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants